#!/bin/bash
# Start postgresql
docker-entrypoint.sh postgres -c max_connections=${POSTGRES_MAX_CONNECTIONS} &
sleep 10
# Wait postgresql
until pg_isready --host=127.0.0.1; do sleep 1 && echo "waiting for postgres"; done

rm -f /opt/wlou/app/tmp/*.pid
# Start WLou
. /opt/wlou/pyenv/bin/activate
# 下载模型
python /opt/wlou/app/install_model.py
# 修改config.yml后运行，数据用户名和密码在init.sql时设置过了
# DEBUG设置为false
python /opt/wlou/app/manage.py compilemessages
python /opt/wlou/app/main.py upgrade_db
python /opt/wlou/app/main.py collect_static
python /opt/wlou/app/main.py dev